<template>
  <div class="searchList">
    <van-nav-bar
      @click-left="onClickLeft"
      fixed
      placeholder
      safe-area-inset-top
      class="color"
    >
      <!-- 为了适应其他模块点击事件 -->
      <template #left>
        <i class="iconfont f38" v-html="icon"></i>
      </template>
      <template #title>
        <div class="title">{{ title }}</div>
      </template>
      <!-- 要有传right才会显示 -->
      <template #right>
        <div class="right" v-if="right">{{ right }}</div>
      </template>
    </van-nav-bar>
  </div>
</template>
<script>
export default {
  props: ['title', 'icon', 'path', 'right'],
  methods: {
    onClickLeft () {
      this.$emit('onleft')
    }
  }
}
</script>
<style lang="less" scoped>
.searchList {
  ::v-deep .van-nav-bar {
    background-image: linear-gradient(45deg, #a748f3, #727ded);
  }
  .f38 {
    font-size: 38px;
    color: #f7f8fa;
  }
  .title {
    font-size: px;
    color: #f7f8fa;
  }
  ::v-deep .van-nav-bar__left,
  ::v-deep .van-nav-bar__right {
    padding: 0;
  }
}
</style>
